<template>
	<view class="terminate">
	<view class="info" v-for="(item,index) in termin" :key='index'>
<!-- 		<view class="cunter">
			<text>充值类型：</text>
			<view class="title">
				<image src="../../static/bizhan/logo.png" mode="widthFix"></image>
				<text>USDT</text>
			</view>
		</view> -->
		
		<view class="cunter">
			<text>充值数量：</text>
			<view class="title">
				<text style="font-weight: 100;">{{item.amount}}</text>
			</view>
		</view>
		

		<view class="cunter">
			<text >充值时间：</text>
			<view class="title">
				<text style="font-weight: 100;">{{item.createTime |time}}</text>
			</view>
		</view>
		
		<view class="cunter">
			<text >当前状态：</text>
			<view class="title">
				<text style="display: inline-block;width: 80px;
				height: 30px;background-color: #00B34D;border-radius: 10upx;
				text-align: center;line-height: 30px;
				font-size: 14px; color: #fff;" v-if="item.entrust == 1" @tap="jie(item.orderId,item.txId)">解约</text>
				<text style="display: inline-block;width: 80px;
				height: 30px;background-color: #FF932F;border-radius: 10upx;
				text-align: center;line-height: 30px;
				font-size: 14px; color: #fff;" v-if="item.entrust == 5" @tap="jie(item.orderId,item.txId)">等待解约...</text>
				<text style="display: inline-block;width: 80px;
				height: 30px;background-color: #999;border-radius: 10upx;
				text-align: center;line-height: 30px;
				font-size: 14px; color: #333;" v-if="item.entrust ==0">已解约</text>
				
			</view>
		</view>
		
	</view>
	</view>
</template>

<script>
	
	export default {
		data(){
			return {
				termin:[],
				flag:false,
				count:0
			}
		},
		onShow() {
			this.terminate()
		},
		methods:{
			terminate(){
				this.$ajax(
				this.apiList.getEntrustInfo,
				{ userId:uni.getStorageSync('userinfo').userId },
				"POST"
				).then(res=>{
					this.termin = res.data
				})
			},
			jie(orderId,txId){
				this.$ajax(
				this.apiList.unEntrust,
				{
						orderId:orderId,
					 txId:txId,
					 userId:uni.getStorageSync('userinfo').userId
				},
				'POST'
				).then(res=>{
						this.terminate()
				})
			}
		}
	}
	
</script>

<style lang="scss" scoped>
	.terminate{
		margin: 0;
		padding: 20upx;
		background: #0E1B45 !important;
background: url(../../static/bizhan/s19.png) no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100%;
overflow: hidden;
overflow-y: scroll;
box-sizing: border-box;
.info {
	width: 100%;
	
	box-sizing: border-box;
	background: url(../../static/bizhan/s18.png) no-repeat;
	background-size: 100% 100%;
	padding: 30upx;
}
.cunter:first-child{
	margin-top: 30upx;
}
.cunter:last-child{
	margin-bottom: 30upx;
}
.cunter {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 40px;
	text {
		color: rgba(176, 176, 176, 1);
		font-size: 14px;
		text-align: left
	}
.title {
	display: flex;
	align-items: center;
	image {
		width: 36px;
		margin-right: 10upx;
			}
			text{
				color: rgba(255, 255, 255, 1);
				font-size: 16px;
				text-align: left;
				font-weight: bold;
			}
}
}
	}
</style>
